﻿using UnityEngine;
using System.Collections;

public class Item : MonoBehaviour {
	public int columnIndex = 0;
	public int rowIndex = 0;

	public float xOffset = -2.2f;
	public float yOffset = -4f;

	public GameController game;
	public bool moveable = true;

	public void UpdatePos(int row, int column){
		this.rowIndex = row;
		this.columnIndex = column;

		Vector3 pos = new Vector3(0,0,0);
		pos.x = xOffset + 0.5f * this.columnIndex;
		if(rowIndex % 2 == 0){
			pos.x +=0.5f;
		}
		pos.y = yOffset + 0.5f * this.rowIndex;

		this.transform.position = pos;
	}

	public void OnMouseDown(){
		//if(moveable){
			game.Select(this);
			//moveable = false;
		//}

	}

}
